#ifndef CLICKEDLABEL_H
#define CLICKEDLABEL_H

#include <QLabel>
#include <QPainter>
#include <QMouseEvent>
#include <QPaintEvent>

class ClickedLabel : public QLabel
{
    Q_OBJECT
public:
    ClickedLabel(QWidget*parent=nullptr);
signals:
    void clicked(const QString&text);
protected:
    void mousePressEvent(QMouseEvent*e)override;
};

class SmallPrintLabel : public ClickedLabel
{
    Q_OBJECT
public:
    SmallPrintLabel(QWidget*parent=nullptr):ClickedLabel(parent),flag(false),realnum(0){connect(this,&SmallPrintLabel::clicked,[this]{flag=true;});}
    void setText(const QString&text,qint32 smallprint);
    void setText(qint32 smallprint);
    void setText(const QString&text);
    void SetFlag(bool f);
    QString text(){return realtext;}

protected:
    void paintEvent(QPaintEvent*e)override;
private:
    bool flag;
    QString realtext;
    qint32 realnum;
};

#endif // CLICKEDLABEL_H
